import subSystem.*;

public class Mainframe {
    private Memory memory;
    private CPU cpu;
    private HardDisk hardDisk;
    private OS os;

    public Mainframe() {
        this.memory = new Memory();
        this.cpu = new CPU();
        this.hardDisk = new HardDisk();
        this.os = new OS();
    }

    // 启动方法
    public void on() {
        System.out.println("正在启动电脑...");
        if (memory.check() && cpu.run() && hardDisk.read() && os.load()) {
            System.out.println("电脑启动成功！");
        } else {
            System.out.println("电脑启动失败！");
        }
    }
}
